package com.ruoyi.app.service.impl;

import com.ruoyi.app.domain.BusRulesRegulations;
import com.ruoyi.app.mapper.BusRulesRegulationsMapper;
import com.ruoyi.app.service.IBusRulesRegulationsService;
import com.ruoyi.common.utils.DateUtils;
import com.ruoyi.common.utils.SecurityUtils;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

/**
 * @author pc
 * @version 1.0
 * @description: TODO
 * @date 2025/9/21 0:53
 */
@Service
public class BusRulesRegulationsServiceImpl implements IBusRulesRegulationsService {

    @Resource
    private BusRulesRegulationsMapper busRulesRegulationsMapper;

    /**
     * 查询业务数据--规章制度
     *
     * @param fileId 业务数据--规章制度主键
     * @return 业务数据--规章制度
     */
    @Override
    public BusRulesRegulations selectBusRulesRegulationsByFileId(Long fileId)
    {
        return busRulesRegulationsMapper.selectBusRulesRegulationsByFileId(fileId);
    }

    /**
     * 查询业务数据--规章制度列表
     *
     * @param busRulesRegulations 业务数据--规章制度
     * @return 业务数据--规章制度
     */
    @Override
    public List<BusRulesRegulations> selectBusRulesRegulationsList(BusRulesRegulations busRulesRegulations)
    {
        return busRulesRegulationsMapper.selectBusRulesRegulationsList(busRulesRegulations);
    }

    /**
     * 新增业务数据--规章制度
     *
     * @param BusRulesRegulations 业务数据--规章制度
     * @return 结果
     */
    @Override
    public int insertBusRulesRegulations(BusRulesRegulations busRulesRegulations)
    {
        busRulesRegulations.setCreateTime(DateUtils.getNowDate());
        busRulesRegulations.setCreateUserId(SecurityUtils.getUserId());
        busRulesRegulations.setCreateUserName(SecurityUtils.getLoginUser().getUser().getNickName());
        return busRulesRegulationsMapper.insertBusRulesRegulations(busRulesRegulations);
    }

    /**
     * 修改业务数据--规章制度
     *
     * @param BusRulesRegulations 业务数据--规章制度
     * @return 结果
     */
    @Override
    public int updateBusRulesRegulations(BusRulesRegulations busRulesRegulations)
    {
        busRulesRegulations.setUpdateTime(DateUtils.getNowDate());
        return busRulesRegulationsMapper.updateBusRulesRegulations(busRulesRegulations);
    }

    /**
     * 批量删除业务数据--规章制度
     *
     * @param fileIds 需要删除的业务数据--规章制度主键
     * @return 结果
     */
    @Override
    public int deleteBusRulesRegulationsByFileIds(Long[] fileIds)
    {
        return busRulesRegulationsMapper.deleteBusRulesRegulationsByFileIds(fileIds);
    }

    /**
     * 删除业务数据--规章制度信息
     *
     * @param fileId 业务数据--规章制度主键
     * @return 结果
     */
    @Override
    public int deleteBusRulesRegulationsByFileId(Long fileId)
    {
        return busRulesRegulationsMapper.deleteBusRulesRegulationsByFileId(fileId);
    }


}
